package com.financial.service.yspay.controller;

import com.financial.service.yspay.service.*;
import com.financial.service.yspay.utils.apiresult.ApiResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author WANGNING
 * @api {post}
 * @email wyn20140226@aliyun.com
 * @tar 银盛业务处理
 * @date 2019/11/5 9:03
 * @apiGroup ys-service
 * @apiVersion 2.0.0
 * @apiHeader {String} null 无
 * @apiParam {String} requestJson 参数传递
 * @apiSuccess {String} succeed 就绪
 */
@RestController
@RequestMapping("/ys")
public class YsServiceController {
    @Autowired
    private FinancialYsPayService financialYsPayService;

    @Autowired
    private FinancialYsSplitService financialYsSplitService;

    @Autowired
    private FinancialYsWithdrawalService financialYsWithdrawalService;

    @Autowired
    private FinancialYsRefundService financialYsRefundService;

    @Autowired
    private FinancialYsPaymentService financialYsPaymentService;
    /**
     * 银盛报备
     *
     * @param requestParam
     * @return
     */
    @RequestMapping(value = {"/report"},method = {RequestMethod.POST})
    @ResponseBody
    public ApiResult report(@RequestBody String requestParam) {

        return null;
    }

    /**
     * 银盛支付
     *
     * @param requestParam
     * @return
     */
    @RequestMapping(value = {"/pay"},method = {RequestMethod.POST})
    @ResponseBody
    public ApiResult pay(@RequestBody String requestParam) {

        return financialYsPayService.ysPay(requestParam);
    }

    /**
     * 银盛分账
     *
     * @param requestParam
     * @return
     */
    @RequestMapping(value = {"/split"}, method = { RequestMethod.POST})
    @ResponseBody
    public ApiResult split(@RequestBody String requestParam) {

        return financialYsSplitService.ysSplit(requestParam);
    }

    /**
     * 银盛提现
     *
     * @param requestParam
     * @return
     */
    @RequestMapping(value = {"/withdrawal"}, method = {RequestMethod.POST})
    @ResponseBody
    public ApiResult withdrawal(@RequestBody String requestParam) {

        return financialYsWithdrawalService.ysWithdrawal(requestParam);
    }

    /**
     * 银盛退款
     *
     * @param requestParam
     * @return
     */
    @RequestMapping(value = {"/refund"}, method = {RequestMethod.POST})
    @ResponseBody
    public ApiResult refund(@RequestBody String requestParam) {

        return financialYsRefundService.ysRefund(requestParam);
    }

    /**
     * 银盛代付/转账
     *
     * @param requestParam
     * @return
     */
    @RequestMapping(value = {"/payment"},method = {RequestMethod.POST})
    @ResponseBody
    public ApiResult payment(@RequestBody String requestParam) {

        return financialYsPaymentService.ysPayment(requestParam);
    }

}
